import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: [{ find: '@', replacement: resolve(__dirname, 'src') }]
  },
  server: {
    hmr: true,
    proxy: {
      '/api': {
        target: 'https://api.apiopen.top/',
        changeOrigin: true,
        // rewrite: (path) => path.replace(/^\/api/, '') // 设置重写的路径
      }
    }
  }
})
